home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / RMVSTR.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  785b  |  50 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; RmvStr-    Subtracts the characters in a string from a set.
  10. ;
  11. ; inputs:
  12. ;
  13. ;    ES:DI-  Points at the set (at its mask byte).
  14. ;    DX:SI-    Points at the string.
  15. ;
  16. ;
  17. ;
  18.         public    sl_RmvStr
  19. ;
  20. sl_RmvStr    proc    far
  21.         push    ds
  22.         push    ax
  23.         push    bx
  24.         push    si
  25.         push    di
  26.         mov    ds, dx
  27. ;
  28.         mov    al, es:[di]        ;Get mask byte
  29.         not    al
  30.         add    di, 8            ;Skip to start of set
  31.         mov    bh, 0
  32.                 jmp    IntoLp
  33. RmvLp:        and    es:[di][bx], al        ;Add to set
  34.         inc    si            ;Move on to next char.
  35. IntoLp:        mov    bl, [si]
  36.         cmp    bl, 0
  37.         jnz    RmvLp
  38. ;
  39.         pop    di
  40.         pop    si
  41.         pop    bx
  42.         pop    ax
  43.         pop    ds
  44.         ret
  45. sl_RmvStr    endp
  46. ;
  47. ;
  48. stdlib        ends
  49.         end
  50.